<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录之后</title>
    <link rel="stylesheet" href="../css/blog.css">

</head>
<body>
<?php
include_once 'blog.php';
?>
<div class="box">
    <header>
        <h2>我的BLOG</h2>
    </header>
    <div class="content clearBox">
        <div class="left">
            <?php
            foreach ($post_data as $post) {
                ?>
                <div>
                    <h5 class="title"><?php echo $post['SUBJECT']; ?></h5>
                    <dl class="blog-body">
                        <dt class="tit-date"><?php echo $post['DATE']; ?></dt>
                        <dd class="body-ctn"><?php echo $post['CONTENT']; ?></dd>
                        <dd class="body-foot">
                            <?php
                            if ($login) {
                                echo '<a href="edit.php?entry=' . $post['FILENAME'] . '">编辑</a>
                                  <a href="delete.php?entry=' . $post['FILENAME'] . '" >删除</a>';
                            }
                            ?>
                        </dd>
                    </dl>
                </div>
            <?php } ?>


        </div>

        <div class="right">
            <div class="sidebar">
                <h5 class="title">关于我</h5>
                <p class="right-ctn">php初学者</p>
            </div>
            <div class="sidebar">
                <h5 class="title">日志归档</h5>
                <?php
                foreach ($class_arr as $ym) {
                    $entry = $ym;
                    echo '<p class="right-ctn"><a href="archives.php?ym='.$entry. '">' . substr($ym, 0, 4) . '-' . substr($ym, 4, 2) . '</a></p>';
                }
                echo ''
                ?>

                <div class="side-foot">
                    <?php
                    if ($login) {
                        echo '<a href="logout.php">退出</a>';
                    } else {
                        echo ' <a href="../index.php">登录</a>';
                    }
                    ?>
                </div>
            </div>
        </div>
    </div>

</div>
<div class="footer">CopyRight&nbsp;2017</div>

</body>
</html>
